package hc.j2me.item;

import hc.j2me.util.Jcip;
import hc.j2me.util.OutPortTranser;

public class ChoiceGroup extends javax.microedition.lcdui.ChoiceGroup implements IPort{

	public ChoiceGroup() {
		super(Jcip.getInstance().getString(), Jcip.getInstance().getInt(),
				Jcip.getInstance().getArrString(), Jcip.getInstance().getArrImage());
		Jcip.getInstance().init(this);
	}

	public void appendOutPort(OutPortTranser out){
		boolean[] bo = new boolean[this.size()];
		getSelectedFlags(bo);
		out.out(bo);
	}

	public void appendInPort(Jcip jcip){
		setSelectedFlags(jcip.convert(jcip.getArrString()));
		setFitPolicy(Integer.parseInt(jcip.getString()));
	}
	
	String id = null;
	public String getID() {
		return id;
	}

	public void setID(String id) {
		this.id = id;
	}

	short ioMode = 0;

	public void setIOMode(short mode) {
		this.ioMode = mode;
	}
	
	public short getIOMode(){
		return ioMode;
	}

}
